package com.dong.pointandviewpager.sample

import android.app.Application
import android.content.Context
import android.util.Log
import android.widget.ImageView
import com.bumptech.glide.Glide
import com.dong.pointviewpager.PVPManager
import com.dong.pointviewpager.interfaces.IImageLoader

/**
 * @description:
 * @author dong
 * @date 2021/12/15 15:51
 */
class PVPApplication: Application() {

    override fun onCreate() {
        super.onCreate()
        PVPManager.init(object : IImageLoader{

            override fun loadImage(context: Context, imageView: ImageView, path: String, placeHolderRes: Int?, errorRes: Int?) {
                Glide.with(context).load(path).into(imageView);
            }

            override fun loadImage(context: Context, imageView: ImageView, res: Int, placeHolderRes: Int?, errorRes: Int?) {
                Glide.with(context).load(res).into(imageView);
            }

        })
    }
}